package org.misty.practices.string;

import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.invoke.StringConcatFactory;

public class StringConcat2 {
public static void main(String[] args) throws Throwable {
    var lookup = MethodHandles.lookup();
    var methodType = MethodType.methodType(String.class, String.class);
    var callSite = StringConcatFactory.makeConcatWithConstants(lookup, "makeConcatWithConstants", methodType, "\u0001World");
    var methodHandler = callSite.dynamicInvoker();
    var res = methodHandler.invoke("Hello");
    System.out.println(res);
}
}
